<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>{:lang('public.system')}</title>
<link href="/static/common/css/iconfont.css" rel="stylesheet">
<link href="/static/admin/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/admin/css/style.min.css" rel="stylesheet">
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/cookie.min.js"></script>
<script type="text/javascript">
    let IM_toget_config = {
        logout: "{:apiUrl('api/Customer/logout')}",
        editAccount: "{:adminUrl('admin/Customer/editAccount')}",
        editPass: "{:adminUrl('admin/Customer/editPass')}",
        ajaxupimg: "{:apiUrl('api/Upload/ajaxupimg')}",
        getchats: "{:apiUrl('api/Chats/getchats')}",
        unread:"{:apiUrl('api/Unread/index')}",
        unreadadmin:"{:adminUrl('admin/Unread/index')}",
    };
    let IM_user = {
        from_id: "{$custs['id']}",
        from_group: "{$custs['group_id']}",
        from_nick: "{$custs['nick']}",
        from_avatar: "{$custs['avatar']}"
    }
    let WS = "{:config('im.WS_address')}";
    let currentvisiid = Cookies.get('currentvisiid');
</script>
</head>
<body>
<div class="lyear-layout-web">
<div class="lyear-layout-container">
{include file="common/sidebar"}
<header class="lyear-layout-header">
    <nav class="navbar navbar-default">
        <div class="topbar">
            <div class="topbar-left">
                <div class="lyear-aside-toggler">
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                </div>
                <span class="navbar-page-title"></span>
            </div>
            <ul class="topbar-right">
                <li class="dropdown dropdown-profile">
                    <a href="javascript:void(0)" data-toggle="dropdown">  
                        <img class="img-avatar img-avatar-30 m-r-10" src="{$custs['avatar']}" alt="{$custs['nick']}">
                        <span class="user-state">
                            <i class="notice user-state-{$custs['state']}"></i>
                            <span class="user-nick">{$custs['nick']}</span>
                        </span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-right">
                        <li>
                            <a href="javascript:loginOut();">
                                <i class="iconfont icon-yuandianxiao circle-state-0"></i>{:lang('user.leave_for')}</a>
                        </li>
                        <li>
                            <a href="javascript:myOnline();">
                                <i class="iconfont icon-yuandianxiao circle-state-1"></i>{:lang('user.im_online')}</a>
                        </li>
                        <li>
                            <a data-toggle="modal" data-target="#accountModal">
                                <i class="iconfont icon-gerenziliao"></i>{:lang('user.personal')}</a>
                        </li>
                        <li>
                            <a data-toggle="modal" data-target="#outlineModal">
                                <i class="iconfont icon-icon-test"></i>{:lang('user.edit_password')}</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="javascript:logout();">
                                <i class="iconfont icon-tuichu"></i>{:lang('user.logout')}</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
<div class="modal fade" id="accountModal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">{:lang('user.personal')}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group am-form-group am-form-file">
                            <label for="pcus-avatar" class="control-label">{:lang('user.avatar')}</label>
                            <img class="img-avatar img-avatar-30 m-r-10" src="{$custs['avatar']}" alt="{$custs['nick']}">
                            <input type="hidden" id="pavatar-src" value="{$custs['avatar']}">
                            <input type="file" class="form-control-file" id="pcus-avatar"><i class="iconfont icon-tupianshangchuan"></i>
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:lang('public.uname')}</label>
                            <input type="text" class="form-control" disabled value="{$custs['uname']}">
                        </div>
                        <div class="form-group">
                            <label for="cus-nick" class="control-label">{:lang('user.nick')}</label>
                            <input type="text" class="form-control" id="cus-nick" value="{$custs['nick']}">
                        </div>
                        <div class="form-group">
                            <label for="cus-phone" class="control-label">{:lang('public.phone')}</label>
                            <input type="text" class="form-control" id="cus-phone" value="{$custs['phone']}">
                        </div>
                        <div class="form-group">
                            <label for="cus-email" class="control-label">{:lang('public.email')}</label>
                            <input type="text" class="form-control" id="cus-email" value="{$custs['email']}">
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:lang('user.web_id')}</label>
                            <input type="text" class="form-control" disabled value="{$custs['web_id']}">
                        </div>
                        <div class="form-group">
                            <label for="cus-group_id" class="control-label">{:lang('user.service_group')}</label>
                            <select class="form-control" id="cus-group_id">
                            {foreach :getDataLists('im_customer_group',"cuid=".$main_id) as $item}
                                <option{:selected($item['id'],$custs['group_id'])} value="{$item['id']}">{$item['name']}</option>
                            {/foreach}
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="editAccount(this);">{:lang('public.edit')}</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">{:lang('public.cancel')}</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="outlineModal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">{:lang('user.edit_password')}</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label">{:lang('user.old_password')}</label>
                            <input type="password" class="form-control" id="old-upass" placeholder="{:lang('user.input_old_password')}">
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:lang('user.new_password')}</label>
                            <input type="password" class="form-control" id="new-upass" placeholder="{:lang('user.input_new_password')}">
                        </div>
                        <div class="form-group">
                            <label class="control-label">{:lang('user.new_password')}</label>
                            <input type="password" class="form-control" id="new2-upass" placeholder="{:lang('user.once_new_password')}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="editPass(this);">{:lang('public.edit')}</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">{:lang('public.cancel')}</button>
            </div>
        </div>
    </div>
</div>